<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <link rel="stylesheet" href="/salt-ui.min.css">
    <style>
        html {
            font-size: 104px;
        }

        body * {
            border-left: 1px solid #b3b3b3;
            border-bottom: 1px solid #b3b3b3;
            width: 100%;
            height: 100vh;
        }
    </style>
    <script src="/pdfobject.min.js"></script>
    <script>
        var embload = function () {
            if (obj.readyState == 4) {
                console.log('pdf')
            }
        }
        window.onload = function () {
            var url = '/its/download_file?file_id=' + window.location.search.split('=')[1];
            // // var url = '/a/20180323it.pdf'
            // // var url = '//127.0.0.1:8111/a'
            // var options = {
            //     pdfOpenParams: {
            //         pagemode: "thumbs",
            //         navpanes: 0,
            //         toolbar: 0,
            //         statusbar: 0,
            //         view: "FitV"
            //     }
            // };

            // var myPDF = PDFObject.embed(url, "#example1", options);
            // debugger
            // window.print();
            var emb = document.getElementById('pdf')
            emb.onload = function (obj) {
                // if (obj.readyState == 4) {
                    console.log('pdf')
                // }
            }
            emb.data = url;
        }
    </script>
</head>

<body>
    <div id="example1">
        <object id="pdf" onreadystatechange="embload(this)" type="application/pdf">
    </div>
</body>

</html>